MONITOR_BASE := 0xFC500000
# Bootloader should load monitor to this real address
LOAD_BASE := 0x00100000
-CFLAGS := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing
-CFLAGS += -iwithprefix include -O3 -Wall -Werror -DMONITOR_BASE=$(MONITOR_BASE)
+CFLAGS := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing -O3
+CFLAGS += -iwithprefix include -Wall -Werror -DMONITOR_BASE=$(MONITOR_BASE)
CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG
#CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__
CFLAGS += -Wno-pointer-arith -Wredundant-decls -m32
unsigned long flags;
irq_desc_t *desc = &irq_desc[irq];
irq_guest_action_t *action;
- int rc;
+ int rc = 0;
if ( !IS_PRIV(p) )
return -EPERM;
if ( !(desc->status & IRQ_GUEST) )
{
- rc = -EBUSY;
if ( desc->action != NULL )
{
DPRINTK("Cannot bind IRQ %d to guest. In use by '%s'.\n",
irq, desc->action->name);
+ rc = -EBUSY;
goto out;
}
- rc = -ENOMEM;
action = kmalloc(sizeof(irq_guest_action_t), GFP_KERNEL);
if ( (desc->action = (struct irqaction *)action) == NULL )
{
DPRINTK("Cannot bind IRQ %d to guest. Out of memory.\n", irq);
+ rc = -ENOMEM;
goto out;
}
goto out;
}
- rc = -EBUSY;
if ( action->nr_guests == IRQ_MAX_GUESTS )
{
DPRINTK("Cannot bind IRQ %d to guest. Already at max share.\n", irq);
+ rc = -EBUSY;
goto out;
}
action->guest[action->nr_guests++] = p;
- rc = 0;
-
out:
spin_unlock_irqrestore(&desc->lock, flags);
return rc;
if ( max == MAX_EVENT_CHANNELS )
return -ENOSPC;
- max = (max == 0) ? 4 : (max * 2);
+ max *= 2;
chn = kmalloc(max * sizeof(event_channel_t), GFP_KERNEL);
if ( unlikely(chn == NULL) )
if ( chn2[port2].u.remote.dom != p1 )
BUG();
- chn2[port2].state = ECS_UNBOUND;
- chn2[port2].u.remote.dom = NULL;
- chn2[port2].u.remote.port = 0xFFFF;
-
+ chn2[port2].state = ECS_UNBOUND;
evtchn_set_exception(p2, port2);
break;
BUG();
}
- chn1[port1].state = ECS_FREE;
- chn1[port1].u.remote.dom = NULL;
- chn1[port1].u.remote.port = 0xFFFF;
-
+ chn1[port1].state = ECS_FREE;
evtchn_set_exception(p1, port1);
out:
* domain's event-channel spinlock. Read accesses can also synchronise on
* the lock, but races don't usually matter.
*/
- u16 pirq_to_evtchn[128];
+#define NR_PIRQS 128 /* Put this somewhere sane! */
+ u16 pirq_to_evtchn[NR_PIRQS];
u16 virq_to_evtchn[NR_VIRQS];
- u32 pirq_mask[2];
+ u32 pirq_mask[NR_PIRQS/32];
/* Physical I/O */
spinlock_t pcidev_lock;
* something may have generated an irq long ago and we want to
* flush such a longstanding irq before considering it as spurious.
*/
- for (i = NR_IRQS-1; i > 0; i--) {
+ for (i = NR_PIRQS-1; i > 0; i--) {
desc = irq_desc + i;
spin_lock_irq(&desc->lock);
* (we must startup again here because if a longstanding irq
* happened in the previous stage, it may have masked itself)
*/
- for (i = NR_IRQS-1; i > 0; i--) {
+ for (i = NR_PIRQS-1; i > 0; i--) {
desc = irq_desc + i;
spin_lock_irq(&desc->lock);
* Now filter out any obviously spurious interrupts
*/
val = 0;
- for (i = 0; i < NR_IRQS; i++) {
+ for (i = 0; i < NR_PIRQS; i++) {
irq_desc_t *desc = irq_desc + i;
unsigned int status;
unsigned int mask;
mask = 0;
- for (i = 0; i < NR_IRQS; i++) {
+ for (i = 0; i < NR_PIRQS; i++) {
irq_desc_t *desc = irq_desc + i;
unsigned int status;
nr_irqs = 0;
irq_found = 0;
- for (i = 0; i < NR_IRQS; i++) {
+ for (i = 0; i < NR_PIRQS; i++) {
irq_desc_t *desc = irq_desc + i;
unsigned int status;